def get_drink(m: int, d: int, b: int, c: int, p: int, br: int, cr: int):

    if m > p:
        tmp = m // p  # 购买瓶数
        d = d + tmp  # 喝的瓶数
        b = b + tmp  # 得到的空瓶数
        c = c + tmp  # 的到的瓶盖数
        m = m % p  # 剩余的钱
        print("花钱购买了{}瓶汽水，当前剩余{}元，手中瓶子{}个，瓶盖{}个，一共喝了{}瓶汽水".format(tmp, m, b, c, d))
    elif b >= br:
        tmp = b // br  # 用空瓶换取的瓶数
        b = b % br  # 用空瓶换取后剩余空瓶
        b = b + tmp  # 用空瓶换取完成后手上的空瓶
        c = c + tmp  # 用空瓶换取完成后手上的瓶盖
        d = d + tmp
        print(
            "用{}个空瓶换了{}瓶汽水，当前剩余{}元，手中瓶子{}个，瓶盖{}个，一共喝了{}瓶汽水".format(tmp * br, tmp, m, b, c,
                                                                                                d))
    elif c >= cr:
        tmp = c // cr  # 用瓶盖换取的瓶数
        c = c % cr  # 用瓶盖换取后剩余瓶盖数
        c = c + tmp  # 用瓶盖换取完成后手上瓶盖数
        b = b + tmp  # 用瓶盖换取完成后手上的空瓶数
        d = d + tmp
        print(
            "用{}个瓶盖换了{}瓶汽水，当前剩余{}元，手中瓶子{}个，瓶盖{}个，一共喝了{}瓶汽水".format(tmp * cr, tmp, m, b, c,
                                                                                                d))
    if m > p or b >= br or c >= cr:
        get_drink(m, d, b, c, p, br, cr)


money = 100
drink = 0
bottle = 0
cap = 0

price = 3
bottle_rate = 3
cap_rate = 5
get_drink(money, drink, bottle, cap, price, bottle_rate, cap_rate)
